﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using TomShane.Neoforce.Controls;

namespace Madrigal
{
    class WndDialog : GameScreen
    {
        Button dialogButton;
        Window dialogWindow;
        TextBox dialogText;
        ImageBox npcImage;

        Manager neoManager;

        public WndDialog(ScreenManager screenManager, Manager manager, int npcID, string dialog)
        {
            neoManager = manager;

            dialogWindow = new Window(neoManager);
            dialogWindow.Init();
            dialogWindow.Text = "Dialog Window";
            dialogWindow.Center();
            dialogWindow.Width = 550; dialogWindow.Height = 350;

            npcImage = new ImageBox(neoManager);
            npcImage.Init();
            npcImage.Image = screenManager.Game.Content.Load<Texture2D>(@"Textures\UI\char\char_InfoPeng");
            npcImage.Parent = dialogWindow;
            npcImage.SetSize(npcImage.Image.Width, npcImage.Image.Height);
            npcImage.SetPosition(dialogWindow.ClientArea.Left + 10, dialogWindow.ClientArea.Top + 5);

            dialogText = new TextBox(neoManager);
            dialogText.Init();
            dialogText.TextColor = Color.Green;
            dialogText.BackColor = new Color(0, 0, 0, 255);
            dialogText.Parent = dialogWindow;
            dialogText.SetSize(315, 240);
            dialogText.SetPosition(npcImage.ClientRect.Right + 20, dialogWindow.ClientArea.Top + 5);
            dialogText.Mode = TextBoxMode.Multiline;
            dialogText.ScrollBars = ScrollBars.Vertical;
            dialogText.Resizable = false;
            dialogText.ReadOnly = true;
            dialogText.Text = dialog;
            dialogText.Parent = dialogWindow;

            dialogButton = new Button(manager);
            dialogButton.Init();
            dialogButton.Name = "btnOK";
            dialogButton.Text = "OK";
            dialogButton.Parent = dialogWindow;

            dialogButton.SetPosition((npcImage.Image.Width + dialogText.Width) / 2, npcImage.ClientRect.Bottom + 36);
            
            

            neoManager.Add(dialogWindow);
            
        }
    }
}
